package io;

import java.io.*;

/**
 *
 */
public class FOSDemo {
    public static void main(String[] args) throws IOException {
//        FileOutputStream fileOutputStream=new FileOutputStream("55.txt");//定义文件输出流
        File file=new File("55.txt");
        FileOutputStream fos=new FileOutputStream(file);
        fos.write(-1);
        fos.write(-8);//写入一个字节，一个write写一个字节
        fos.close();//流用完必须要关
        FileInputStream fim=new FileInputStream(file);
        Integer i =fim.read();
        System.out.println(i);
        i=fim.read();
        System.out.println(i);
        fim.close();
    }
}
